package chat.server;

import java.util.List;
import javax.swing.SwingUtilities;
import chat.server.gui.ServerStatusGUI;

public class ServerGuiListener implements ServerListener {
	
	private ServerStatusGUI statusGUI;

	public ServerGuiListener(ServerStatusGUI statusGUI){
		this.statusGUI = statusGUI;
	}
	
	
	@Override
	public void updateRoom(final List<String> roomList) {
		
		Runnable doWorkRunnable = new Runnable() {
		    public void run() { 
		    	statusGUI.updateRoomList(roomList); }
		};
		SwingUtilities.invokeLater(doWorkRunnable);
		
	}
	

}
